/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Juanan
 */
@Entity
@Table(name = "par_parameter")
@NamedQueries(
{
    @NamedQuery(name = "ParParameter.findAll", query = "SELECT p FROM ParParameter p")
})
public class ParParameter implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "PAR_ID")
    private Integer parId;
    @Basic(optional = false)
    @Column(name = "PAR_NAME")
    private String parName;
    @Basic(optional = false)
    @Column(name = "PAR_DESCRIPTION")
    private String parDescription;
    @Basic(optional = false)
    @Column(name = "PAR_I18N")
    private String parI18n;
    @Basic(optional = false)
    @Column(name = "PAR_TYPE")
    private String parType;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "parId")
    private Collection<CodCoding> codCodingCollection;

    public ParParameter()
    {
    }

    public ParParameter(Integer parId)
    {
        this.parId = parId;
    }

    public ParParameter(Integer parId, String parName, String parDescription, String parI18n, String parType)
    {
        this.parId = parId;
        this.parName = parName;
        this.parDescription = parDescription;
        this.parI18n = parI18n;
        this.parType = parType;
    }

    public Integer getParId()
    {
        return parId;
    }

    public void setParId(Integer parId)
    {
        this.parId = parId;
    }

    public String getParName()
    {
        return parName;
    }

    public void setParName(String parName)
    {
        this.parName = parName;
    }

    public String getParDescription()
    {
        return parDescription;
    }

    public void setParDescription(String parDescription)
    {
        this.parDescription = parDescription;
    }

    public String getParI18n()
    {
        return parI18n;
    }

    public void setParI18n(String parI18n)
    {
        this.parI18n = parI18n;
    }

    public String getParType()
    {
        return parType;
    }

    public void setParType(String parType)
    {
        this.parType = parType;
    }

    public Collection<CodCoding> getCodCodingCollection()
    {
        return codCodingCollection;
    }

    public void setCodCodingCollection(Collection<CodCoding> codCodingCollection)
    {
        this.codCodingCollection = codCodingCollection;
    }

    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += (parId != null ? parId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object)
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ParParameter))
        {
            return false;
        }
        ParParameter other = (ParParameter) object;
        if ((this.parId == null && other.parId != null) || (this.parId != null && !this.parId.equals(other.parId)))
        {
            return false;
        }
        return true;
    }

    @Override
    public String toString()
    {
        return "entities.ParParameter[ parId=" + parId + " ]";
    }
    
}
